﻿using System;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Shipping;

namespace Nop.Core.Domain.Logistics
{
    public partial class PackageNote : BaseEntity
    {
        /// <summary>
        /// Gets or sets the order identifier
        /// </summary>
        public int PackageId { get; set; }

        /// <summary>
        /// Gets or sets the customer identifier
        /// </summary>
        public int CustomerId { get; set; }

        /// <summary>
        /// Gets or sets the note
        /// </summary>
        public string Note { get; set; }

        /// <summary>
        /// Gets or sets the location information
        /// </summary>
        public string Location { get; set; }

        /// <summary>
        /// Gets or sets the shipping status identifier
        /// </summary>
        public int? ShippingStatusId { get; set; }

        /// <summary>
        /// Gets or sets the location address identifier if applicable
        /// </summary>
        public int? AddressId { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether a customer can see a note
        /// </summary>
        public bool DisplayToCustomer { get; set; }

        /// <summary>
        /// Gets or sets a value indicating the type of the package note
        /// </summary>
        public int TypeId { get; set; }

        /// <summary>
        /// Gets or sets the date and time of package note creation
        /// </summary>
        public DateTime CreatedOnUtc { get; set; }

        /// <summary>
        /// Gets or sets the type of the package note
        /// </summary>
        public virtual PackageNoteType Type
        {
            get
            {
                return (PackageNoteType)this.TypeId;
            }
            set
            {
                this.TypeId = (int)value;
            }
        }

        /// <summary>
        /// Gets or sets the shipping status
        /// </summary>
        public virtual ShippingStatus? ShippingStatus
        {
            get
            {
                return ShippingStatusId.HasValue ? (ShippingStatus?)this.ShippingStatusId : null;
            }
            set
            {
                this.ShippingStatusId = value.HasValue ? (int?)value : null;
            }
        }

        /// <summary>
        /// Gets the package
        /// </summary>
        public virtual LogisticsPackage Package { get; set; }

        /// <summary>
        /// Gets the customer
        /// </summary>
        public virtual Customer Customer { get; set; }
    }
}
